package com.tt.service;

import java.util.List;

import org.json.JSONObject;
import org.springframework.stereotype.Service;

import com.tt.bean.GroupBean;
import com.tt.dao.GroupDaoImpl;
import com.tt.dao.UserFriendListImpl;
@Service
public class HomePageSocketImpl implements HomePageSocket {
	//@Autowired
	UserFriendListImpl userFriendListImpl = new UserFriendListImpl();
	GroupDaoImpl groupDaoImpl = new GroupDaoImpl();
	@Override
	public int sendReq(JSONObject json, String userid) {
		Long uid = Long.parseLong(userid);
		String a = json.get("id").toString();
		Long fid =  Long.parseLong(a);
		int count = userFriendListImpl.sendReq(uid, fid);
		return count;
	}
	@Override
	public List<GroupBean> selectGroupFriend(Long id, Long uid) {
		List<GroupBean> list = groupDaoImpl.selectGroupFriend(id,uid);
		return list;
	}
}
